#ifndef COLLECTORSERVICE_H
#define COLLECTORSERVICE_H

#include "collector.h"

class CollectorService : public QtService<QCoreApplication>
{
public:
    CollectorService(int argc, char *argv[]):
        QtService<QCoreApplication>(argc, argv, SP_NAME)
    {
        setServiceDescription("Collector Service For QVertex Project");
    }

protected:
    void start()
    {
        QCoreApplication *app = application();
        sp_setRegValue(REG_APP,"serviceName",serviceName());
        sp_setRegValue(REG_APP,"status","Running");

        collector=new Collector(app);
        collector->start();
    }

    void stop()
    {
        sp_setRegValue(REG_APP,"status","Stopped");
        collector->stop();
    }
private:
    Collector *collector;
};

#endif // COLLECTORSERVICE_H
